-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: offload mp4/ts probe to web worker #1117
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1117 +/- ##
==========================================
+ Coverage 86.30% 86.40% +0.09%
==========================================
Files 38 39 +1
Lines 9072 9628 +556
Branches 2054 2176 +122
==========================================
+ Hits 7830 8319 +489
- Misses 1242 1309 +67
Continue to review full report at Codecov.
|
270c34a
to
be43752
Compare
// start time. Meaning cached frame data may corrupt our notion of where this segment | ||
// really starts. To get around this, full segment appends should probe for the info | ||
// needed. | ||
workerCallback({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thing I'm curious about is now that this is asynchronous, the trackInfo, audioStart, and videoStart functions may come from different places (either from the probe or from the transmuxer). Due to cached data in the transmuxer, I wonder if this could lead to some different behavior due to race conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't send anything to the transmuxer until the probe comes back, so I wouldn't think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed that, you're right 👍
test/segment-loader.test.js
Outdated
@@ -911,8 +936,7 @@ QUnit.module('SegmentLoader', function(hooks) { | |||
this.clock.tick(1); | |||
|
|||
// decryption tick for syncWorker | |||
this.clock.tick(1); | |||
|
|||
this.clock.tick(2); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth adding a comment for the extra tick
} | ||
transmuxer.removeEventListener('message', listenForEndEvent); | ||
|
||
// transfer ownership of bytes back to us. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the ownership is transferred here, do we need to transfer the ownership again in the media-segment-request users of workerCallback
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do for anywhere else the data is referenced.
Description
offloads ts / mp4 probing to the web worker saving us ~600 gzipped bytes.